"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var rxjs_1 = require("rxjs");
var dgram_1 = require("dgram");
function createDgramSocket(type) {
    if (type === void 0) { type = 'udp4'; }
    return rxjs_1.Observable.create(function (obser) {
        var server = dgram_1.createSocket(type, function (msg, rinfo) {
            obser.next({
                server: server,
                msg: msg,
                rinfo: rinfo
            });
        });
    });
}
exports.createDgramSocket = createDgramSocket;
